import {createRouter, createWebHistory} from 'vue-router'


const routes = [
    {
        path: '/',
        component: () => import('@/views/layout/index.vue'),
        children: [
            {
                path: '',
                name: 'home',
                component: () => import('@/views/home/index.vue')
            },
        ]
    },
    {
        path: '/error',
        name: 'error',
        component: () => import('@/views/error/index.vue')
    },
    // 其他路由配置...
    {
        path: '/:pathMatch(.*)*', // 404 页面
        name: 'NotFound',
        component: () => import('@/views/error/index.vue')
    }
]


const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    // path和component对应关系的位置
    routes: routes
})

export default router
